<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* nth-child 选取子元素 没有类型限制，子元素都会占位置 */
        ul li p:nth-child(3) {
            color: red;
        }

        /* nth-of-type 会有类型限制 ，会选取指定类型 然后再写具体n */
        ul li p:nth-of-type(2) {
            color: orange;
        }
    </style>
</head>

<body>
    <ul>
        <li>
            <a href="">test1</a>
            <p>段落1</p>
            <p>段落2</p>
            <p>段落3</p>
            <h1>666</h1>
        </li>
    </ul>
</body>

</html>